from datetime import datetime

from src.init.init_db import db
from src.utils.model import BaseModel


class ArticleModel(BaseModel):
    __tablename__ = 'article'  # 文章表

    aid = db.Column(db.BigInteger, primary_key=True) # 文章id
    title = db.Column(db.String(100))  # 文章标题
    description = db.Column(db.Text)  # 文章摘要
    content = db.Column(db.Text)  # 文章内容
    cover = db.Column(db.String(300))  # 文章封面
    view = db.Column(db.Integer, default=0)  # 文章浏览量
    tid = db.Column(db.BigInteger)  # 文章类型
    uid = db.Column(db.BigInteger)  # 创建者
    audit = db.Column(db.Boolean, default=True)  # 是否通过审核
    createtime = db.Column(db.DateTime, default=datetime.now)  # 创建时间
